package com.ruoyi.edubuy.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.edubuy.domain.ShowBuyOrder;
import com.ruoyi.edubuy.mapper.ShowBuyOrderMapper;
import com.ruoyi.edubuy.service.IShowBuyOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单查询Service业务层处理
 *
 * @author lsj
 * @date 2021-07-13
 */
@Service
public class ShowBuyOrderServiceImpl implements IShowBuyOrderService {
    @Autowired
    private ShowBuyOrderMapper showBuyOrderMapper;

    /**
     * 查询订单查询
     *
     * @param orderId 订单查询ID
     * @return 订单查询
     */
    @Override
    public ShowBuyOrder selectShowBuyOrderById(Integer orderId) {
        return showBuyOrderMapper.selectShowBuyOrderById(orderId);
    }

    /**
     * 查询订单查询列表
     *
     * @param showBuyOrder 订单查询
     * @return 订单查询
     */
    @Override
    public List<ShowBuyOrder> selectShowBuyOrderList(ShowBuyOrder showBuyOrder) {
        return showBuyOrderMapper.selectShowBuyOrderList(showBuyOrder);
    }

    /**
     * 新增订单查询
     *
     * @param showBuyOrder 订单查询
     * @return 结果
     */
    @Override
    public int insertShowBuyOrder(ShowBuyOrder showBuyOrder) {
        return showBuyOrderMapper.insertShowBuyOrder(showBuyOrder);
    }

    /**
     * 修改订单查询
     *
     * @param showBuyOrder 订单查询
     * @return 结果
     */
    @Override
    public int updateShowBuyOrder(ShowBuyOrder showBuyOrder) {
        return showBuyOrderMapper.updateShowBuyOrder(showBuyOrder);
    }

    /**
     * 删除订单查询对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteShowBuyOrderByIds(String ids) {
        return showBuyOrderMapper.deleteShowBuyOrderByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除订单查询信息
     *
     * @param orderId 订单查询ID
     * @return 结果
     */
    @Override
    public int deleteShowBuyOrderById(Integer orderId) {
        return showBuyOrderMapper.deleteShowBuyOrderById(orderId);
    }
}
